import React, { Component } from 'react'
import {Switch, Route, Redirect} from 'react-router-dom'
import '../css/Layout.css'
import Home from './Home'
import Cate from './Cate'
import Cart from './Cart'
import Mime from './Mime'
// 底部导航栏
import MyTabBar from './MyTabBar'

export default class Layout extends Component {
  render() {
    return (
      <div className="layout">
        {/* 上方切换内容，嵌套路由 */}
        <Switch>
          <Route path="/index/home" exact component={Home}></Route>
          <Route path="/index/cate" exact component={Cate}></Route>
          <Route path="/index/cart" exact component={Cart}></Route>
          <Route path="/index/mime" exact component={Mime}></Route>
          <Redirect to="/index/home"></Redirect>
        </Switch>
        {/* 底部导航栏 */}
        <MyTabBar></MyTabBar>
      </div>
    )
  }
}
